// pages/test/show.js
const app = getApp();
var utils = require('../../utils/util.js');
function getRandomColor() {
  let rgb = []
  for (let i = 0; i < 3; ++i) {
    let color = Math.floor(Math.random() * 256).toString(16)
    color = color.length == 1 ? '0' + color : color
    rgb.push(color)
  }
  return '#' + rgb.join('')
}

Page({
  onReady: function (res) {
    this.videoContext = wx.createVideoContext('myVideo')
  },
  inputValue: '',
  data: {
    src: '',
    danmuList: [
      {
        text: '第 1s 出现的弹幕',
        color: '#ff0000',
        time: 1
      },
      {
        text: '第 3s 出现的弹幕',
        color: '#ff00ff',
        time: 3
      }]
  },
  onLoad:function(e){
    var id = e.id;
    var that = this;
    that.setData({
      imgPath: app.d.imgPath
    })
    var sucFunc = function (that, res) {
      that.setData({
        url: res.data,
      })
    }
    var data = { id:id }
    utils.wxRequest(that, app.d.path, "Video/index", data, sucFunc);
    
  },
  bindpause:function(e){
    console.log(e);
  },
  bindtimeupdate:function(e){
    console.log(e);
  }

})